package com.anxin.common.bean;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class AuthSession implements Serializable {

	private static final long serialVersionUID = -9147848378687245205L;

	private String sessionId;

	private String realm;

	private String nonce;

	private long userId;

	private boolean isRememberLogin;

	/**
	 * 过期时间，秒
	 */
	private int expiredTimeSeconds;

	private Map<String, Object> attributes = new HashMap<>();

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public Object getAttribute(String key) {
		return this.attributes.get(key);
	}

	public void setAttribute(String key, Object value) {
		this.attributes.put(key, value);
	}

	public void removeAttribute(String key) {
		this.attributes.remove(key);
	}

	public String getRealm() {
		return realm;
	}

	public void setRealm(String realm) {
		this.realm = realm;
	}

	public String getNonce() {
		return nonce;
	}

	public void setNonce(String nonce) {
		this.nonce = nonce;
	}

	public boolean isRememberLogin() {
		return isRememberLogin;
	}

	public void setRememberLogin(boolean isRememberLogin) {
		this.isRememberLogin = isRememberLogin;
	}

	public int getExpiredTimeSeconds() {
		return expiredTimeSeconds;
	}

	public void setExpiredTimeSeconds(int expiredTimeSeconds) {
		this.expiredTimeSeconds = expiredTimeSeconds;
	}

}
